﻿namespace IS.Projecto.Modelo
{
    public class Sala : Entidade
    {
        public string Designacao { get; set; }

        public bool Equals(Sala other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return Equals(other.Designacao, Designacao);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (Sala)) return false;
            return Equals((Sala) obj);
        }

        public override int GetHashCode()
        {
            return (Designacao != null ? Designacao.GetHashCode() : 0);
        }

        public static bool operator ==(Sala left, Sala right)
        {
            return Equals(left, right);
        }

        public static bool operator !=(Sala left, Sala right)
        {
            return !Equals(left, right);
        }
    }
}